import Card from './Card'
import BoyPic  from '@/assets/pic1.jpg'
import GirlPic  from '@/assets/pic.png'
import {useState} from 'react'
const Home=()=>{
    const [msg,setMsg]=useState('')
    let students=[
        {
          id:'10001',
          name:'刘备',
          age:23,
          major:'WEB前端',
          avatar:BoyPic
        },
        {
            id:'10002',
            name:'貂蝉',
            age:18,
            major:'Java开发',
            avatar:GirlPic
        },
        {
            id:'10003',
            name:'小乔',
            age:18,
            major:'测试开发'
        }
    ]
    return(
        <>
            <div style={{width:'500px',height:'30px',backgroundColor:'pink'}}>{msg}</div>
            <div style={{display:'flex'}}>
                {
                    students.map(item=><Card {...item} key={item.id} browserInfo={arg=>{
                        setMsg(`您点击了${arg}同学的信息`)
                    }}></Card>)
                }
            </div>
        </>
    )
}
export default Home